<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>原型对象创建方法案例</title>
    </head>
    <body>
        <p id="111"></p>
        <p id="222"></p>
        <p id="333"></p>
        <script>
            function Clothes(aaa, bbb) {
                this.aaa = aaa;
                this.bbb = bbb;
            }
            Clothes.prototype.Clothes_fun = function() {
                return this.aaa + "是" + this.bbb
            };
            var clothes1 = new Clothes("黑色的连衣裙", "小丽穿的衣服");
            var clothes2 = new Clothes("黄色的吊带裙", "小美穿的衣服");
 
            document.getElementById("111").innerHTML = clothes1.Clothes_fun();
            document.getElementById("222").innerHTML = clothes2.Clothes_fun();
            Clothes.prototype = {
                Clothes_fun: function() {
                    return this.bbb + "是" + this.aaa
                }
            }
            var clothes1 = new Clothes("黑色的连衣裙", "小丽穿的衣服");
            document.getElementById("333").innerHTML = clothes1.Clothes_fun();
        </script>
    </body>
    <html>